


RegRead("HKLM\SOFTWARE\PlayOnlineUS\SquareEnix\FinalFantasyXI", "0001")
If @error = 1 Then
	Global $resx = RegRead("HKLM\SOFTWARE\PlayOnlineEU\SquareEnix\FinalFantasyXI", "0001")
	Global $resy = RegRead("HKLM\SOFTWARE\PlayOnlineEU\SquareEnix\FinalFantasyXI", "0002")
	Global $install = RegRead("HKLM\SOFTWARE\PlayOnlineEU\Installfolder", "0001")
	$useu = ("EU")
Else
	Global $resx = RegRead("HKLM\SOFTWARE\PlayOnlineUS\SquareEnix\FinalFantasyXI", "0001")
	Global $resy = RegRead("HKLM\SOFTWARE\PlayOnlineUS\SquareEnix\FinalFantasyXI", "0002")
	Global $install = RegRead("HKLM\SOFTWARE\PlayOnlineUS\Installfolder", "0001")
	$useu = ("US")
EndIf

Global $resa = @DesktopWidth
Global $resb = @DesktopHeight
Global $resadded = $resx + $resy
Global $winadded = $resa + $resb


Select
	Case $resadded = 1400
		$wr = .585
		$hr = .57
		$pic = "hlaunch1.bmp"
	Case $resadded = 1792
		$wr = .8
		$hr = .745
		$pic = "hlaunch2.bmp"
	Case $resadded = 2016
		$wr = .89
		$hr = .84
		$pic = "hlaunch3.bmp"
	Case $resadded = 2000
		$wr = 1
		$hr = .695
		$pic = "hlaunch4.bmp"
	Case $resadded = 2048
		$wr = 1
		$hr = .745
		$pic = "hlaunch5.bmp"
	Case $resadded = 2240
		$wr = 1
		$hr = .937
		$pic = "hlaunch6.bmp"
	Case $resadded = 2304
		$wr = 1
		$hr = 1
		$pic = "hlaunch.bmp"
	Case $resadded = 2128
		$wr = 1.0625
		$hr = .745
		$pic = "hlaunch7.bmp"
	Case $resadded = 2384
		$wr = 1.0625
		$hr = 1
		$pic = "hlaunch8.bmp"
	Case $resadded = 2340
		$wr = 1.14
		$hr = .88
		$pic = "hlaunch9.bmp"
	Case $resadded = 2800
		$wr = 1.28
		$hr = 1.185
		$pic = "hlaunch10.bmp"
	Case $resadded = 2730
		$wr = 1.35
		$hr = 1.03
		$pic = "hlaunch11.bmp"
	Case $resadded = 3136
		$wr = 1.45
		$hr = 1.325
		$pic = "hlaunch12.bmp"
	Case $resadded = 3240
		$wr = 1.45
		$hr = 1.425
		$pic = "hlaunch13.bmp"
EndSelect


$Helpers = GUICreate("Rogue Tools", 160 * $wr, 160 * $hr, 43 * $wr, 775 * $hr, $WS_POPUP, $WS_EX_TOPMOST + $WS_EX_TOOLWINDOW)
$a = DllCall(".\BMP2RGN.dll", "int", "BMP2RGN", _
		"str", @ProgramFilesDir & "\Burnersware\Rogue Tools\Include\img\hl\" & $pic, _
		"int", 0, _
		"int", 12, _
		"int", 84)

SetWindowRgn($Helpers, $a[0])


If ProcessExists("Rogue Tools.exe") Then
	$f = 0
Else
	MsgBox(4096, "Rogue Tools?", "You need to be running Rogue Tools in order to use this control")
	Exit
EndIf


$rdms = GUICtrlCreateLabel("", 10 * $wr, 9 * $hr, 35 * $wr, 35 * $hr)
GUICtrlSetTip(-1, "Redmage Solo Helper")
$rdmp = GUICtrlCreateLabel("", 116 * $wr, 9 * $hr, 35 * $wr, 35 * $hr)
GUICtrlSetTip(-1, "Redmage Party Helper")
$blm = GUICtrlCreateLabel("", 10 * $wr, 116 * $hr, 35 * $wr, 35 * $hr)
GUICtrlSetTip(-1, "Blackmage Helper")
$whm = GUICtrlCreateLabel("", 114 * $wr, 116 * $hr, 35 * $wr, 35 * $hr)
GUICtrlSetTip(-1, "Whitemage Helper")
$ajh = GUICtrlCreateLabel("", 63 * $wr, 63 * $hr, 35 * $wr, 35 * $hr)
GUICtrlSetTip(-1, "All Jobs Helper")
GUICtrlCreatePic(@ProgramFilesDir & "\Burnersware\Rogue Tools\Include\img\hl\hlaunch.bmp", 0, 0, 160 * $wr, 160 * $hr)
DllCall("user32.dll", "int", "AnimateWindow", "hwnd", $Helpers, "int", 500, "long", 0x00080000)
GUISetState()
While 1
	$Message = GUIGetMsg()
	Select
		Case $Message = $GUI_EVENT_CLOSE
			DllCall("user32.dll", "int", "AnimateWindow", "hwnd", $Helpers, "int", 1000, "long", 0x00090000)
			Exit
		Case $Message = $rdms
			If WinExists("FFXI Windower Helper - RDM") Then
				WinActivate("FFXI Windower Helper - RDM")
				Exit
			Else
				Run(@ProgramFilesDir & "\Burnersware\Rogue Tools\Include\plugins\RDM Console - Solo Edition\FFXI RDM Console - Solo Edition.exe", @ProgramFilesDir & "\Burnersware\Rogue Tools\Include\plugins\RDM Console - Solo Edition\")
				DllCall("user32.dll", "int", "AnimateWindow", "hwnd", $Helpers, "int", 1000, "long", 0x00090000)
				Exit
			EndIf
		Case $Message = $rdmp
			If WinExists("FFXI Windower Helper - RDM") Then
				WinActivate("FFXI Windower Helper - RDM")
				Exit
			Else
				Run(@ProgramFilesDir & "\Burnersware\Rogue Tools\Include\plugins\RDM Console - Party Edition\RDMConsole_PE.exe", @ProgramFilesDir & "\Burnersware\Rogue Tools\Include\plugins\RDM Console - Party Edition\")
				DllCall("user32.dll", "int", "AnimateWindow", "hwnd", $Helpers, "int", 1000, "long", 0x00090000)
				Exit
			EndIf
		Case $Message = $blm
			If WinExists("FFXI Windower Helper - BLM") Then
				WinActivate("FFXI Windower Helper - BLM")
				Exit
			Else
				Run(@ProgramFilesDir & "\Burnersware\Rogue Tools\Include\plugins\FFXI BLM Console\FFXI BLM Console.exe", @ProgramFilesDir & "\Burnersware\Rogue Tools\Include\plugins\FFXI BLM Console\")
				DllCall("user32.dll", "int", "AnimateWindow", "hwnd", $Helpers, "int", 1000, "long", 0x00090000)
				Exit
			EndIf
		Case $Message = $whm
			If WinExists("FFXI Windower Helper - Whitemage") Then
				WinActivate("FFXI Windower Helper - Whitemage")
				Exit
			Else
				Run(@ProgramFilesDir & "\Burnersware\Rogue Tools\Include\plugins\FFXI WHM Console\FFXI WHM Console.exe", @ProgramFilesDir & "\Burnersware\Rogue Tools\Include\plugins\FFXI WHM Console\")
				DllCall("user32.dll", "int", "AnimateWindow", "hwnd", $Helpers, "int", 1000, "long", 0x00090000)
				Exit
			EndIf
		Case $Message = $ajh
			If WinExists("FFXI Windower Helper - All Jobs") Then
				WinActivate("FFXI Windower Helper - All Jobs")
				Exit
			Else
				Run(@ProgramFilesDir & "\Burnersware\Rogue Tools\Include\plugins\FFXI All Jobs Helper\FFXIAllJobsHelper.exe", @ProgramFilesDir & "\Burnersware\Rogue Tools\Include\plugins\FFXI All Jobs Helper\")
				DllCall("user32.dll", "int", "AnimateWindow", "hwnd", $Helpers, "int", 1000, "long", 0x00090000)
				Exit
			EndIf
	EndSelect
WEnd

Func SetWindowRgn($h_win, $rgn)
	DllCall("user32.dll", "long", "SetWindowRgn", "hwnd", $h_win, "long", $rgn, "int", 1)
EndFunc ;==>SetWindowRgn

Func RunByAssoc($szFile)
	$nPos = StringInStr($szFile, ".", 0, -1)
	If Not $nPos Then Return 0
	$szExtension = StringTrimLeft($szFile, $nPos - 1)
	$szRegValue = RegRead("HKCR\" & $szExtension, "")
	If @error Then Return 0
	$szRegValue = RegRead("HKCR\" & $szRegValue & "\shell\open\command", "")
	If @error Then Return 0
	$nPos = StringInStr($szRegValue, ".exe")
	If Not $nPos Then $nPos = StringInStr($szRegValue, ".com")
	If Not $nPos Then
		$szRegValue = '"' & @ComSpec & '" /c '
	Else
		$szRegValue = StringLeft($szRegValue, $nPos + 4)
	EndIf
	If StringRight($szRegValue, 1) == '"' Then $szRegValue = $szRegValue & " "
	If StringRight($szRegValue, 1) <> ' ' Then $szRegValue = $szRegValue & " "
	If StringLeft($szFile, 1) <> '"' Then $szFile = '"' & $szFile
	If StringRight($szFile, 1) <> '"' Then $szFile = $szFile & '"'
	If Run($szRegValue & $szFile) Then Return 1
	Return 0
EndFunc ;==>RunByAssoc


